#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> sortedSquares(vector<int>& nums) {
	for (vector<int>::iterator it = nums.begin(); it < nums.end(); it++) {
		(*it) = (*it) * (*it);
	}
	sort(nums.begin(), nums.end(), less<int>());
	return nums;
}
int main()
{
	vector<int>nums;
	int n;
	while (cin >> n) {
		nums.push_back(n);
		if (cin.get() == '\n') break;
	}
	vector<int>result = sortedSquares(nums);
	for (vector<int>::iterator it = result.begin(); it < result.end(); it++) {
		cout << *it << ' ';
	}
	return 0;
}